#ifndef _SPINLOCK_H_
#define _SPINLOCK_H_

typedef struct {
    int locked;
    const char *name;  // 锁的名称，用于调试
} spinlock;

void initlock(spinlock *lk, const char *name);
void acquire(spinlock *lk);
void release(spinlock *lk);

#endif
